/*
 * @Author: szx
 * @Date: 2022-03-04 13:57:25
 * @LastEditTime: 2022-03-04 14:00:07
 * @Description:
 * @FilePath: \leetcode\500-599\513\513_2.js
 */
var findBottomLeftValue = function (root) {
    let res;
    let maxLen = 0;
    const dfs = (root, len) => {
        root.left && dfs(root.left, len + 1);
        root.right && dfs(root.right, len + 1);
        if (len > maxLen) {
            maxLen = len;
            res = root.val;
        }
    };
    return res;
};
